﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class MatHangXuatKhoBUS
    {
        #region 1.InsertMatHangXuatKho

        public static bool InsertMatHangXuatKho(MatHangXuatKhoDTO matHangXuatKho)
        {
            if (MatHangXuatKhoDAO.CheckIDMaMatHangExits(matHangXuatKho.MaMatHang,matHangXuatKho.MaPhieuXuat))
            {
                return false;
            }
            return MatHangXuatKhoDAO.InsertHangXuatKho(matHangXuatKho);
        }
        
        #endregion

        #region 2.Retrieving

        public static bool CheckIDMatHangXuatKhoExits(string maMatHang,string maPhieuXuat)
        {
            return MatHangXuatKhoDAO.CheckIDMaMatHangExits(maMatHang, maPhieuXuat);
        }
        public static List<MatHangXuatKhoDTO> SelectMatHangXuatKhoByID(string maID, string maPhieuXuat)
        {
            return MatHangXuatKhoDAO.SelectMatHangXuatKhoAllByID(maID, maPhieuXuat);
        }

        #endregion
    }
}
